<template>
  <div class="pubmanage-container">
    <div class="header">
      <span>当前位置：</span>
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>公告管理</el-breadcrumb-item>
        <el-breadcrumb-item>公告修改</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="pubcontent">
      <h1 class="arti-title">
        {{pubinfo.title}}
      </h1>
      <p class="arti-metas">
        <span class="arti-time">{{pubinfo.time}}</span>
        <span class="arti-from">发布者：{{pubinfo.from}}</span>
      </p>
      <div class="article">
        <p>
          　　{{pubinfo.article}}
        </p>
      </div>
    </div>
    <el-button type="primary" @click="dialogVisible = true">修改公告</el-button>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <edit_form ref="submit_child"></edit_form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submit"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
import edit_form from "@/views/Admin/Content/Pubmanage/Form/index";
import {mapState} from 'vuex'
export default {
  name: "",
  data() {
    return {
      dialogVisible: false,
    };
  },
  methods: {
    handleClose() {
      this.dialogVisible = false;
    },
    submit(){
      this.dialogVisible = false;
    }
  },
  mounted() {
    this.$store.dispatch("getpubinfo");
  },
  components: {
    edit_form,
  },
  computed: {
    ...mapState({
      pubinfo:(state)=>{
        return state.admin.pubinfo
      }
    })
  }
};
</script>

<style lang="less" scoped>
.pubmanage-container {
  text-align: center;
  .header {
    text-align: left;
    height: 30px;
    line-height: 30px;
    border-bottom: 1px solid #ccc;
    .el-breadcrumb {
      display: inline-block;
    }
    & > span {
      font-size: 16px;
    }
  }
  .pubcontent {
    margin-top: 20px;
    .arti-title {
      height: 40px;
      line-height: 40px;
      text-align: center;
      font-size: 28px;
    }
    .arti-metas {
      padding-bottom: 10px;
      border-bottom: 1px solid #ccc;
      span {
        margin: 0 10px;
        color: #999;
        font-size: 12px;
        display: inline-block;
      }
    }
    .article {
      overflow: scroll !important;
      font-size: 15px;
      text-align: justify;
      p {
        line-height: 1.7;
        margin: 8px 0;
        font-family: "微软雅黑";
      }
    }
  }
  & > button {
    margin: 0 auto;
  }
}
</style>
